/*
import { jest } from '@jest/globals';

// 模拟 localStorage
const localStorageMock = {
  getItem: jest.fn(),
  setItem: jest.fn(),
  removeItem: jest.fn(),
  clear: jest.fn(),
  length: 0,
  key: jest.fn(),
};

Object.defineProperty(window, 'localStorage', {
  value: localStorageMock,
});

// 模拟 fetch
global.fetch = jest.fn(() =>
  Promise.resolve({
    url: '',
    ok: true,
    status: 200,
    statusText: 'OK',
    headers: new Headers(),
    json: () => Promise.resolve({}),
    text: () => Promise.resolve(''),
  })
) as jest.Mock;

// 模拟 XMLHttpRequest
const xhrMockClass = function () {
  return {
    open: jest.fn(),
    send: jest.fn(),
    setRequestHeader: jest.fn(),
    readyState: 4,
    status: 200,
    responseURL: '',
    response: '',
    responseText: '',
    onload: null,
    onerror: null,
    onreadystatechange: null,
    addEventListener: jest.fn(),
    removeEventListener: jest.fn(),
  };
};

// @ts-ignore
window.XMLHttpRequest = jest.fn().mockImplementation(xhrMockClass); */
